// 巴洛克广场地图修复（删除僵尸锁人情况下巴洛克广场第二部分的地窖出口，防止堵门）

string author = "Live";
string pluginName = "mapfix_barlowe02";
string version = "1.0";

// 插件初始化
void OnPluginInit()
{
	// 设置插件信息
	PluginData::SetAuthor(author);
	PluginData::SetName(pluginName);
	PluginData::SetVersion(version);

	// 提示
	ThePresident.InfoFeed("插件:"+pluginName+"| 版本:"+version+"| 作者:"+author,false);

}

void ThePresident_OnMapStart() 
{
    ThePresident_OnRoundStart();
}

void ThePresident_OnRoundStart() 
{ 
    // 注册按钮按下事件
    Entities::RegisterUse( "button_elevatoracces" );
}

void OnButtonUsed( CTerrorPlayer@ pPlayer, CBaseEntity@ pEntity) 
{ 
    deleteDoor();
}

void deleteDoor(){
    if( ThePresident.IsHordeMode() ){
        string name = "func_door_rotating";
        CBaseEntity @pEnt = FindEntityByClassname(null,name);
        while( pEnt !is null ){
            pEnt.SUB_Remove();
            @pEnt = FindEntityByClassname( pEnt, name );
            // Chat.PrintToChat(all,"删除掉了一个旋转门");
        }
        Chat.PrintToChat(all,"地图修复提示：检测到当前开启了僵尸锁定，为防止卡出口，自动删除了旋转门");
    }
}